package com.onefinger.manager.managers
{
	import com.onefinger.manager.views.model.BaseCRUDModel;
	import com.onefinger.manager.views.model.SubCategoryCRUDModel;
	import com.onefinger.manager.vos.Subcategory;
	
	import flash.events.Event;
	import flash.events.EventDispatcher;
	import flash.events.IEventDispatcher;
	
	import mx.collections.ArrayCollection;
	
	public class SubCategoryManager extends BaseManager
	{
		
		//--------------------------------------------------------------------
		//    Public Setters and Getters
		//--------------------------------------------------------------------
		
		
		//.................Subcategories......................
		private var _subcategories:ArrayCollection;
		
		[Bindable(event="changeSubCategories")]	
		public function get subcategories():ArrayCollection
		{
			return _subcategories;
		}
		
		public function setSubcategories(value:ArrayCollection):void
		{
			_subcategories = value;
			dispatchEvent( new Event( "changeSubCategories" ) );
		}
		
		public function addCategory(value:Subcategory):void
		{
			_subcategories.addItem(value);
			dispatchEvent( new Event( "changeSubCategories" ) );
		}
		//.................Subcategory......................
		private var _subcategory:Subcategory=new Subcategory();
		
		[Bindable(event="changeSubCategory")]
		public function get subcategory():Subcategory
		{
			return _subcategory;
		}
		public function setSubcategory(value:Subcategory):void
		{
			_subcategory = value;
			dispatchEvent( new Event( "changeSubCategory" ) );
		}
		public function selectSubcategory(value:Subcategory):void
		{
			_subcategory = value;
			dispatchEvent( new Event( "changeSubCategory" ) );
		}
	}
}